// DlgMapFile.cpp : implementation file
//

#include "stdafx.h"
#include "OpenCVView.h"
#include "DlgMapFile.h"


// CDlgMapFile dialog

IMPLEMENT_DYNAMIC(CDlgMapFile, CDialog)

CDlgMapFile::CDlgMapFile(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgMapFile::IDD, pParent)
	, m_SelMapFile(_T(""))
{

}

CDlgMapFile::~CDlgMapFile()
{
}

void CDlgMapFile::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_LIST_MAP, m_listmap);
}


BEGIN_MESSAGE_MAP(CDlgMapFile, CDialog)
	ON_BN_CLICKED(IDOK, &CDlgMapFile::OnBnClickedOk)
	ON_BN_CLICKED(IDCANCEL, &CDlgMapFile::OnBnClickedCancel)
END_MESSAGE_MAP()


// CDlgMapFile message handlers


BOOL CDlgMapFile::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  Add extra initialization here
	std::map<CString,CDrawOpenCV*>::iterator it;
	for( it = CMediaData::g_MapFile.begin(); it!= CMediaData::g_MapFile.end() ; ++it)
	{
		m_listmap.AddString(it->first);
	}

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}


void CDlgMapFile::OnBnClickedOk()
{
	// TODO: Add your control notification handler code here
	m_listmap.GetText(m_listmap.GetCurSel(),m_SelMapFile);
	CDialog::OnOK();
}


void CDlgMapFile::OnBnClickedCancel()
{
	// TODO: Add your control notification handler code here
	CDialog::OnCancel();
}


// GetSelMapFile
CString CDlgMapFile::GetSelMapFile(void)
{
	return m_SelMapFile;
}
